#include "lifesync.h"

LifeSync::LifeSync(QWidget *parent) : QWidget(parent), mainWindow(new Ui::LifeSync)
{
    mainWindow->setupUi(this);
    miniWindow = new MiniLifeSync;

    info = new Info(this);
    unlock = new Unlocked(this);
    check = new Checklist(this);
    quick = new QuickLaunch();
    settings = new Settings(this);
    contacts = new Contacts(this);
    favEdit = new FavoritesEdit(this);
    calculator = new Calculator(this);
    calendarWindow = new CalendarWindow(this);

    favEdit->setQuickPointer(quick);

    //Set the main window with no frame
    this->setWindowFlags(Qt::CustomizeWindowHint);

    //LifeSync main load settings call
    readSettings();

    //LifeSync window transparency launch
    this->setWindowOpacity(sliderDoubleValue);
    settings->setWindowOpacity(sliderDoubleValue);
    contacts->setWindowOpacity(sliderDoubleValue);
    favEdit->setWindowOpacity(sliderDoubleValue);
    quick->setWindowOpacity(sliderDoubleValue);
    miniWindow->setWindowOpacity(sliderDoubleValue);
    info->setWindowOpacity(sliderDoubleValue);
    unlock->setWindowOpacity(sliderDoubleValue);
    check->setWindowOpacity(sliderDoubleValue);
    calculator->setWindowOpacity(sliderDoubleValue);
    calendarWindow->setWindowOpacity(sliderDoubleValue);

    //Everytime LifeSync launches increment programCounter
    programCounter += 1;

    //QTimer .5sec Delay: When rewards are available they will be displayed to the user after .5sec.
    QTimer::singleShot(500, this, SLOT(rewardsUpdates()));

    //MiniLifeSync Signals: Connect Mini LifeSync's button signals to the same slots as LifeSync's button signals
    connect(miniWindow->miniLife->miniContactsDisplay_Button, SIGNAL(clicked()), this, SLOT(on_contactsDisplay_Button_clicked()));
    connect(miniWindow->miniLife->miniCalendarDisplay_Button, SIGNAL(clicked()), this, SLOT(on_calendarDisplay_Button_clicked()));
    connect(miniWindow->miniLife->miniCalculatorDisplay_Button, SIGNAL(clicked()), this, SLOT(on_calculatorDisplay_Button_clicked()));
    connect(miniWindow->miniLife->miniSettingsDisplay_Button, SIGNAL(clicked()), this, SLOT(on_settingsDisplay_Button_clicked()));
    connect(miniWindow->miniLife->miniFavoritesDisplay_Button, SIGNAL(clicked()), this, SLOT(on_favoritesDisplay_Button_clicked()));
    connect(miniWindow->miniLife->miniInfoDisplay_Button, SIGNAL(clicked()), this, SLOT(on_informationDisplay_Button_clicked()));
    connect(miniWindow->miniLife->miniChecklistDisplay_Button, SIGNAL(clicked()), this, SLOT(on_checklistDisplay_Button_clicked()));

    //MiniLifeSync Signals: Quick Launch Display
    connect(miniWindow->miniLife->miniQuickLaunchDisplay_Button, SIGNAL(clicked()), this, SLOT(miniQuickLaunchDisplay()));

    //Settings Signals: Avatar Changes
    connect(settings->settingsWindow->customChange_Button, SIGNAL(clicked()), this, SLOT(Custom_Avatar_Changed()));
    connect(settings->settingsWindow->peopleAnimals_List, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(Avatar_Changed(QListWidgetItem*)));
    connect(settings->settingsWindow->holidays_List, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(Avatar_Changed(QListWidgetItem*)));
    connect(settings->settingsWindow->extra_List, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(Avatar_Changed(QListWidgetItem*)));

    //Settings Signals: Theme Changes
    connect(settings->settingsWindow->pickColor_List, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(colorSet_WindowChanges(QListWidgetItem*)));
    connect(settings->settingsWindow->colorDefault_Button, SIGNAL(clicked()), this, SLOT(colorDefault_WindowChanges()));

    //Settings Signals: Window Control Changes
    connect(settings->settingsWindow->lifeSyncMini_Button, SIGNAL(clicked()), this, SLOT(enableLifeSyncMini()));
    connect(settings->settingsWindow->lifeSyncFull_Button, SIGNAL(clicked()), this, SLOT(enableLifeSyncFull()));

    //Settings Signals: Disable Sound Changes
    connect(settings->settingsWindow->disableSound_Check, SIGNAL(clicked()), this, SLOT(lifeSyncSounds()));

    //Settings Signals: LifeSync Window Transparency
    connect(settings->settingsWindow->windowTransparency_Slider, SIGNAL(valueChanged(int)), this, SLOT(setLifeSyncWindowTransparency(int)));

    //Settings Signals: Button Style Changes
    connect(settings->settingsWindow->enableButtonsOne_Button, SIGNAL(clicked()), this, SLOT(enableButtonStyleOne()));
    connect(settings->settingsWindow->enableButtonsTwo_Button, SIGNAL(clicked()), this, SLOT(enableButtonStyleTwo()));
    connect(settings->settingsWindow->enableButtonsThree_Button, SIGNAL(clicked()), this, SLOT(enableButtonStyleThree()));
    connect(settings->settingsWindow->enableButtonsFour_Button, SIGNAL(clicked()), this, SLOT(enableButtonStyleFour()));
}

//Tracks left mouse button clicks
void LifeSync::mousePressEvent(QMouseEvent *mouse)
{
    if (mouse->buttons() == Qt::LeftButton)
    {
        currentPos = mouse->pos();
    }
}

//Tracks mouse move/drag events
void LifeSync::mouseMoveEvent(QMouseEvent *mouse)
{
    if (mouse->buttons() == Qt::LeftButton)
    {
        move(mouse->globalPos() - currentPos);
    }
}

void LifeSync::readSettings()
{
     QSettings LifeSyncSettings("LifeSync", "Project LifeSync");

     //LifeSync: Window Position Load Settings
     QPoint pos = LifeSyncSettings.value("pos", QPoint(200, 200)).toPoint();
     move(pos);

     //LifeSync: Program Counter Load Settings
     programCounter = LifeSyncSettings.value("programCounter", 0).toInt();

     //LifeSync: Main's Button Load Settings
     mainWindow->contactsDisplay_Button->setStyleSheet(LifeSyncSettings.value("contactsButton", "QPushButton{background-image: url(:/mainImages/versionOne/mainWindow/images/mainImages/versionOne/mainWindow/contacts.png)}").toString());
     mainWindow->calculatorDisplay_Button->setStyleSheet(LifeSyncSettings.value("calculatorButton", "QPushButton{background-image: url(:/mainImages/versionOne/mainWindow/images/mainImages/versionOne/mainWindow/calculator.png)}").toString());
     mainWindow->checklistDisplay_Button->setStyleSheet(LifeSyncSettings.value("checklistButton", "QPushButton{background-image: url(:/mainImages/versionOne/mainWindow/images/mainImages/versionOne/mainWindow/checklist.png)}").toString());
     mainWindow->calendarDisplay_Button->setStyleSheet(LifeSyncSettings.value("calendarButton", "QPushButton{background-image: url(:/mainImages/versionOne/mainWindow/images/mainImages/versionOne/mainWindow/calendar.png)}").toString());
     mainWindow->favoritesDisplay_Button->setStyleSheet(LifeSyncSettings.value("favoritesButton", "QPushButton{background-image: url(:/mainImages/versionOne/mainWindow/images/mainImages/versionOne/mainWindow/favorites.png)}").toString());
     mainWindow->informationDisplay_Button->setStyleSheet(LifeSyncSettings.value("infoButton", "QPushButton{background-image: url(:/mainImages/versionOne/mainWindow/images/mainImages/versionOne/mainWindow/info.png)}").toString());
     mainWindow->settingsDisplay_Button->setStyleSheet(LifeSyncSettings.value("settingsButton", "QPushButton{background-image: url(:/mainImages/versionOne/mainWindow/images/mainImages/versionOne/mainWindow/settings.png)}").toString());
     mainWindow->closeLifeSync_Button->setStyleSheet(LifeSyncSettings.value("quitButton", "QPushButton{background-image: url(:/mainImages/versionOne/mainWindow/images/mainImages/versionOne/mainWindow/quit.png)}").toString());

     //Window & Label: Stylesheet Load Settings
     qApp->setStyleSheet(LifeSyncSettings.value("mainstyle", "QWidget#LifeSync{background-color:none}").toString());
     miniWindow->setStyleSheet(LifeSyncSettings.value("ministyle", "QMainWindow#MiniLifeSync{background-color:none}").toString());
     quick->setStyleSheet(LifeSyncSettings.value("quickstyle", "QMainWindow#QuickLaunch{background-color:none}").toString());
     check->setStyleSheet(LifeSyncSettings.value("checkstyle", "QDialog#Checklist{background-color:none}").toString());
     calculator->setStyleSheet(LifeSyncSettings.value("calcstyle", "QDialog#Calculator{background-color:none}").toString());
     calendarWindow->setStyleSheet(LifeSyncSettings.value("calendstyle", "QMainWindow{background-color:none}").toString());
     contacts->setStyleSheet(LifeSyncSettings.value("contactstyle", "QMainWindow#Contacts{background-color:none}").toString());
     settings->setStyleSheet(LifeSyncSettings.value("settingstyle", "QDialog#Settings{background-color:none}").toString());
     info->setStyleSheet(LifeSyncSettings.value("infostyle", "QDialog#Info{background-color:none}").toString());
     favEdit->setStyleSheet(LifeSyncSettings.value("favEditstyle", "QMainWindow#FavoritesEdit{background-color:none}").toString());
     settings->settingsWindow->allColor_Label->setStyleSheet(LifeSyncSettings.value("settingsall", "QLabel{background:none}").toString());
     settings->settingsWindow->mainColor_Label->setStyleSheet(LifeSyncSettings.value("settingsmain", "QLabel{background:none}").toString());
     settings->settingsWindow->settingsColor_Label->setStyleSheet(LifeSyncSettings.value("settingssettings", "QLabel{background:none}").toString());
     settings->settingsWindow->infoColor_Label->setStyleSheet(LifeSyncSettings.value("settingsinfo", "QLabel{background:none}").toString());
     settings->settingsWindow->calculatorColor_Label->setStyleSheet(LifeSyncSettings.value("settingscalculator", "QLabel{background:none}").toString());
     settings->settingsWindow->checklistColor_Label->setStyleSheet(LifeSyncSettings.value("settingschecklist", "QLabel{background:none}").toString());
     settings->settingsWindow->contactsColor_Label->setStyleSheet(LifeSyncSettings.value("settingscontacts", "QLabel{background:none}").toString());
     settings->settingsWindow->favoritesColor_Label->setStyleSheet(LifeSyncSettings.value("settingsfavorites", "QLabel{background:none}").toString());
     settings->settingsWindow->calendarColor_Label->setStyleSheet(LifeSyncSettings.value("settingscalendar", "QLabel{background:none}").toString());

     //Avatar & Title: Image Load Settings
     QPixmap mainAvatar = LifeSyncSettings.value("mainAvatar", QPixmap(QString::fromUtf8(":/avatars/images/avatars/lifesync_avatar.png"))).value<QPixmap>();
     mainWindow->avatar_Label->setPixmap(QPixmap(mainAvatar));
     QPixmap miniAvatar = LifeSyncSettings.value("miniAvatar", QPixmap(QString::fromUtf8(":/avatars/images/avatars/lifesync_avatar.png"))).value<QPixmap>();
     miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(miniAvatar));
     QPixmap mainTitle = LifeSyncSettings.value("mainTitle", QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title.png"))).value<QPixmap>();
     mainWindow->lifeSyncTitle_Label->setPixmap(QPixmap(mainTitle));
     QPixmap miniTitle = LifeSyncSettings.value("miniTitle", QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_mini.png"))).value<QPixmap>();
     miniWindow->miniLife->miniTitle_Label->setPixmap(QPixmap(miniTitle));

     //Sound: Disable Load Settings
     settings->settingsWindow->disableSound_Check->setChecked(LifeSyncSettings.value("soundDisable").toBool());
     disableSounds = LifeSyncSettings.value("disableSounds", false).toBool();
     disableSoundsCheck = LifeSyncSettings.value("disableSoundsCheck", 0).toInt();

     //Rewards: Medals Unlocked Load Settings
     settings->settingsWindow->goldMedal_LineEdit->setText(LifeSyncSettings.value("goldUnlocks", "0").toString());
     settings->settingsWindow->silverMedal_LineEdit->setText(LifeSyncSettings.value("silverUnlocks", "0").toString());
     settings->settingsWindow->bronzeMedal_LineEdit->setText(LifeSyncSettings.value("bronzeUnlocks", "0").toString());
     settings->rewardsPoints = LifeSyncSettings.value("rewardsPoints", 0).toInt();

     //LifeSync Windows: Transparency Load Settings
     sliderDoubleValue = LifeSyncSettings.value("TransparencyValue", 1.0).toDouble();
     settings->settingsWindow->windowTransparency_Slider->setValue(LifeSyncSettings.value("TransparencySliderValue", 10).toInt());
     settings->settingsWindow->windowTransparency_LineEdit->setText(LifeSyncSettings.value("TransparencyLineEditValue", "10").toString());
}

void LifeSync::writeSettings()
{
     QSettings LifeSyncSettings("LifeSync", "Project LifeSync");

     //LifeSync: Window Position Save Settings
     LifeSyncSettings.setValue("pos", pos());

     //LifeSync: Program Counter Save Settings
     LifeSyncSettings.setValue("programCounter", programCounter);

     //LifeSync: Main's Button Save Settings
     LifeSyncSettings.setValue("contactsButton", mainWindow->contactsDisplay_Button->styleSheet());
     LifeSyncSettings.setValue("calculatorButton", mainWindow->calculatorDisplay_Button->styleSheet());
     LifeSyncSettings.setValue("checklistButton", mainWindow->checklistDisplay_Button->styleSheet());
     LifeSyncSettings.setValue("calendarButton", mainWindow->calendarDisplay_Button->styleSheet());
     LifeSyncSettings.setValue("favoritesButton", mainWindow->favoritesDisplay_Button->styleSheet());
     LifeSyncSettings.setValue("infoButton", mainWindow->informationDisplay_Button->styleSheet());
     LifeSyncSettings.setValue("settingsButton", mainWindow->settingsDisplay_Button->styleSheet());
     LifeSyncSettings.setValue("quitButton", mainWindow->closeLifeSync_Button->styleSheet());

     //Window & Label: Stylesheet Save Settings
     LifeSyncSettings.setValue("mainstyle", qApp->styleSheet());
     LifeSyncSettings.setValue("ministyle", miniWindow->styleSheet());
     LifeSyncSettings.setValue("quickstyle", quick->styleSheet());
     LifeSyncSettings.setValue("checkstyle", check->styleSheet());
     LifeSyncSettings.setValue("calcstyle", calculator->styleSheet());
     LifeSyncSettings.setValue("calendstyle", calendarWindow->styleSheet());
     LifeSyncSettings.setValue("contactstyle", contacts->styleSheet());
     LifeSyncSettings.setValue("settingstyle", settings->styleSheet());
     LifeSyncSettings.setValue("infostyle", info->styleSheet());
     LifeSyncSettings.setValue("favEditstyle", favEdit->styleSheet());
     LifeSyncSettings.setValue("settingsall", settings->settingsWindow->allColor_Label->styleSheet());
     LifeSyncSettings.setValue("settingsmain", settings->settingsWindow->mainColor_Label->styleSheet());
     LifeSyncSettings.setValue("settingssettings", settings->settingsWindow->settingsColor_Label->styleSheet());
     LifeSyncSettings.setValue("settingsinfo", settings->settingsWindow->infoColor_Label->styleSheet());
     LifeSyncSettings.setValue("settingscalculator", settings->settingsWindow->calculatorColor_Label->styleSheet());
     LifeSyncSettings.setValue("settingschecklist", settings->settingsWindow->checklistColor_Label->styleSheet());
     LifeSyncSettings.setValue("settingscontacts", settings->settingsWindow->contactsColor_Label->styleSheet());
     LifeSyncSettings.setValue("settingsfavorites", settings->settingsWindow->favoritesColor_Label->styleSheet());
     LifeSyncSettings.setValue("settingscalendar", settings->settingsWindow->calendarColor_Label->styleSheet());

     //Avatar & Title: Image Save Settings
     LifeSyncSettings.setValue("mainAvatar", mainWindow->avatar_Label->pixmap()->toImage());
     LifeSyncSettings.setValue("miniAvatar", miniWindow->miniLife->miniAvatar_Label->pixmap()->toImage());
     LifeSyncSettings.setValue("mainTitle", mainWindow->lifeSyncTitle_Label->pixmap()->toImage());
     LifeSyncSettings.setValue("miniTitle", miniWindow->miniLife->miniTitle_Label->pixmap()->toImage());

     //Sound: Disable Save Settings
     LifeSyncSettings.setValue("soundDisable", settings->settingsWindow->disableSound_Check->checkState());
     LifeSyncSettings.setValue("disableSoundsCheck", disableSoundsCheck);
     LifeSyncSettings.setValue("disableSounds", disableSounds);

     //Rewards: Medals Unlocked Save Settings
     LifeSyncSettings.setValue("goldUnlocks", settings->settingsWindow->goldMedal_LineEdit->text());
     LifeSyncSettings.setValue("silverUnlocks", settings->settingsWindow->silverMedal_LineEdit->text());
     LifeSyncSettings.setValue("bronzeUnlocks", settings->settingsWindow->bronzeMedal_LineEdit->text());
     LifeSyncSettings.setValue("rewardsPoints", settings->rewardsPoints);

     //LifeSync Windows: Transparency Save Settings
     LifeSyncSettings.setValue("TransparencyValue", sliderDoubleValue);
     LifeSyncSettings.setValue("TransparencySliderValue", settings->settingsWindow->windowTransparency_Slider->value());
     LifeSyncSettings.setValue("TransparencyLineEditValue", settings->settingsWindow->windowTransparency_LineEdit->text());

     /*
     LifeSyncSettings.remove("programCounter");
     LifeSyncSettings.remove("goldUnlocks");
     LifeSyncSettings.remove("silverUnlocks");
     LifeSyncSettings.remove("bronzeUnlocks");
     LifeSyncSettings.remove("rewardsPoints");
     */
}

/*
    Based upon user input that is selected from the lists, the appropriate image will be displayed as the main avatar image
*/
void LifeSync::Avatar_Changed(QListWidgetItem* avatar)
{
    if(avatar->text() == "Male")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/male.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/male.png")));
    }
    else if(avatar->text() == "Female")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/female.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/female.png")));
    }
    else if(avatar->text() == "Goofy")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/goofy.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/goofy.png")));
    }
    else if(avatar->text() == "Panda")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/panda.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/panda.png")));
    }
    else if(avatar->text() == "Dolphin")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/dolphin.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/dolphin.png")));
    }
    else if(avatar->text() == "Elephant")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/elephant.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/elephant.png")));
    }
    else if(avatar->text() == "Turtle")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/turtle.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/turtle.png")));
    }
    else if(avatar->text() == "Butterfly")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/butterfly.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/butterfly.png")));
    }
    else if(avatar->text() == "DJ")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/dj.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/dj.png")));
    }
    else if(avatar->text() == "Pilot")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/pilot.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/pilot.png")));
    }
    else if(avatar->text() == "Spiderman")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/spiderman.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/spiderman.png")));
    }
    else if(avatar->text() == "Octavius")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/octavius.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/octavius.png")));
    }
    else if(avatar->text() == "Green Goblin")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/goblin.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/goblin.png")));
    }
    else if(avatar->text() == "Soldier")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/soldier1.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/soldier1.png")));
    }
    else if(avatar->text() == "Elite Soldier")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/soldier3.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/soldier3.png")));
    }
    else if(avatar->text() == "Super Soldier")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/soldier2.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/soldier2.png")));
    }
    else if(avatar->text() == "Sniper")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/soldier4.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/soldier4.png")));
    }
    else if(avatar->text() == "Frog")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/frog.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/frog.png")));
    }
    else if(avatar->text() == "Boss Soldier")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/soldier5.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/soldier5.png")));
    }
    else if(avatar->text() == "Cow")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/cow.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/cow.png")));
    }
    else if(avatar->text() == "Terminator")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/terminator.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/terminator.png")));
    }
    else if(avatar->text() == "Boss")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/boss.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/boss.png")));
    }
    else if(avatar->text() == "Gamer")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/gamer.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/gamer.png")));
    }
    else if(avatar->text() == "Guard")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/guard.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/guard.png")));
    }
    else if(avatar->text() == "Rhino Xing")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/warning_rhinoceros.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/warning_rhinoceros.png")));
    }
    else if(avatar->text() == "Red Ornament")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_red_ornament.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_red_ornament.png")));
    }
    else if(avatar->text() == "Green Ornament")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_green_ornament.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_green_ornament.png")));
    }
    else if(avatar->text() == "Christmas Tree")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_tree.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_tree.png")));
    }
    else if(avatar->text() == "Santa")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_santa.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_santa.png")));
    }
    else if(avatar->text() == "Reindeer")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_reindeer.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_reindeer.png")));
    }
    else if(avatar->text() == "Snowman")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_snowman.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_snowman.png")));
    }
    else if(avatar->text() == "Candy Cane")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_cane.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_cane.png")));
    }
    else if(avatar->text() == "Christmas Hat")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_hat.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_hat.png")));
    }
    else if(avatar->text() == "Pumpkin")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/halloween_pumpkin.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/halloween_pumpkin.png")));
    }
    else if(avatar->text() == "Eye")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/halloween_eye.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/halloween_eye.png")));
    }
    else if(avatar->text() == "Mask")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/halloween_mask.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/halloween_mask.png")));
    }
    else if(avatar->text() == "Spider")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/halloween_spider.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/halloween_spider.png")));
    }
    else if(avatar->text() == "Skull")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/halloween_skull.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/halloween_skull.png")));
    }
    else if(avatar->text() == "Jack")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/halloween_jack.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/halloween_jack.png")));
    }
    else if(avatar->text() == "Headphones")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/headphones.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/headphones.png")));
    }
    else if(avatar->text() == "Airplane")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/airplane.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/airplane.png")));
    }
    else if(avatar->text() == "Helicopter")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/helicopter.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/helicopter.png")));
    }
    else if(avatar->text() == "Linux")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/linux.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/linux.png")));
    }
    else if(avatar->text() == "Windows")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/windows.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/windows.png")));
    }
    else if(avatar->text() == "Apple")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/apple.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/apple.png")));;
    }
    else if(avatar->text() == "Chess")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/chess.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/chess.png")));
    }
    else if(avatar->text() == "Guitar")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/guitar.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/guitar.png")));
    }
    else if(avatar->text() == "Fire Toy")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/toy.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/toy.png")));
    }
    else if(avatar->text() == "LifeSync")
    {
        mainWindow->avatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/lifesync_avatar.png")));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/lifesync_avatar.png")));
    }
    else
    {
        QMessageBox::information( 0, tr("Locked"), tr("Avatar has not been unlocked yet."), tr("Ok") );
    }
}

/*
    If user clicks "customChange_Button" then the user is presented with an window to search and select an image to display as the main avatar image
*/
void LifeSync::Custom_Avatar_Changed()
{
    QString filename = QFileDialog::getOpenFileName(this, tr("Open File"), QDir::currentPath());

    if (!filename.isEmpty())
    {
        QImage image(filename);

        if(image.isNull())
        {
            errorDisplay = "No Image Was Selected";
            mainWindow->newsAlerts_TextEdit->setText(errorDisplay);
        }

        mainWindow->avatar_Label->setPixmap(QPixmap::fromImage(image));
        miniWindow->miniLife->miniAvatar_Label->setPixmap(QPixmap::fromImage(image));
    }
}

/*
    The core Window Color Function which depending on what button the user clicks the appropriate function calls will be made
*/
void LifeSync::allWindowColor_Functions()
{
    connect(settings->settingsWindow->allColor_Button, SIGNAL(clicked()), this, SLOT(allColor_WindowChanges()));
    connect(settings->settingsWindow->settingsColor_Button, SIGNAL(clicked()), this, SLOT(settingsColor_WindowChanges()));
    connect(settings->settingsWindow->infoColor_Button, SIGNAL(clicked()), this, SLOT(informationColor_WindowChanges()));
    connect(settings->settingsWindow->contactsColor_Button, SIGNAL(clicked()), this, SLOT(contactsColor_WindowChanges()));
    connect(settings->settingsWindow->mainColor_Button, SIGNAL(clicked()), this, SLOT(mainColor_WindowChanges()));
    connect(settings->settingsWindow->calenderColor_Button, SIGNAL(clicked()), this, SLOT(calendarColor_WindowChanges()));
    connect(settings->settingsWindow->checklistColor_Button, SIGNAL(clicked()), this, SLOT(checklistColor_WindowChanges()));
    connect(settings->settingsWindow->calculatorColor_Button, SIGNAL(clicked()), this, SLOT(calculatorColor_WindowChanges()));
    connect(settings->settingsWindow->favoritesColor_Button, SIGNAL(clicked()), this, SLOT(favoritesColor_WindowChanges()));
}

/*
    Once the user has clicked a color this function will determine where to branch to change the appropriate windows
    Clicking a color will also notify the user of what color is currently selected via "selectedColorDisplay_Label"

    Example: If the user selects color "Red" and clicks the "Info" button then the function "informationColor_WindowChanges" is called.
             "SelectedColorDisplay_Label" will also be set to red.
*/
void LifeSync::colorSet_WindowChanges(QListWidgetItem* color)
{
    if(color->text() == "Red")
    {
        windowColorCheck = 1;
        settings->settingsWindow->selectedColorDisplay_Label->setPixmap(QPixmap(QString::fromUtf8(":/colors/images/colors/red.PNG")));
        allWindowColor_Functions();
    }
    else if(color->text() == "Orange")
    {
        windowColorCheck = 2;
        settings->settingsWindow->selectedColorDisplay_Label->setPixmap(QPixmap(QString::fromUtf8(":/colors/images/colors/orange.PNG")));
        allWindowColor_Functions();
    }
    else if(color->text() == "Yellow")
    {
        windowColorCheck = 3;
        settings->settingsWindow->selectedColorDisplay_Label->setPixmap(QPixmap(QString::fromUtf8(":/colors/images/colors/yellow.PNG")));
        allWindowColor_Functions();
    }
    else if(color->text() == "Green")
    {
        windowColorCheck = 4;
        settings->settingsWindow->selectedColorDisplay_Label->setPixmap(QPixmap(QString::fromUtf8(":/colors/images/colors/green.PNG")));
        allWindowColor_Functions();
    }
    else if(color->text() == "Teal")
    {
        windowColorCheck = 5;
        settings->settingsWindow->selectedColorDisplay_Label->setPixmap(QPixmap(QString::fromUtf8(":/colors/images/colors/teal.PNG")));
        allWindowColor_Functions();
    }
    else if(color->text() == "Blue")
    {
        windowColorCheck = 6;
        settings->settingsWindow->selectedColorDisplay_Label->setPixmap(QPixmap(QString::fromUtf8(":/colors/images/colors/blue.PNG")));
        allWindowColor_Functions();
    }
    else if(color->text() == "Pink")
    {
        windowColorCheck = 7;
        settings->settingsWindow->selectedColorDisplay_Label->setPixmap(QPixmap(QString::fromUtf8(":/colors/images/colors/pink.PNG")));
        allWindowColor_Functions();
    }
    else if(color->text() == "Purple")
    {
        windowColorCheck = 8;
        settings->settingsWindow->selectedColorDisplay_Label->setPixmap(QPixmap(QString::fromUtf8(":/colors/images/colors/purple.PNG")));
        allWindowColor_Functions();
    }
    else if(color->text() == "Magenta")
    {
        windowColorCheck = 9;
        settings->settingsWindow->selectedColorDisplay_Label->setPixmap(QPixmap(QString::fromUtf8(":/colors/images/colors/magenta.PNG")));
        allWindowColor_Functions();
    }
    else if(color->text() == "Voilet")
    {
        windowColorCheck = 10;
        settings->settingsWindow->selectedColorDisplay_Label->setPixmap(QPixmap(QString::fromUtf8(":/colors/images/colors/voilet.PNG")));
        allWindowColor_Functions();
    }
}

/*
    eachWindowColor_Functions will be called only by allColor_WindowChanges and colorDefault_WindowChanges
*/
void LifeSync::eachWindowColor_Functions(QString windowColor, QString titleColor)
{
    qApp->setStyleSheet("QWidget#LifeSync { background-color: " + windowColor + " }");
    miniWindow->setStyleSheet("QMainWindow#MiniLifeSync { background-color: " + windowColor + " }");
    settings->setStyleSheet("QDialog#Settings { background-color: " + windowColor + " }");
    info->setStyleSheet("QDialog#Info { background-color: " + windowColor + " }");
    check->setStyleSheet("QDialog#Checklist { background-color: " + windowColor + " }");
    contacts->setStyleSheet("QMainWindow#Contacts { background-color: " + windowColor + " }");
    calendarWindow->setStyleSheet("QMainWindow { background-color: " + windowColor + " }");
    calculator->setStyleSheet("QDialog#Calculator { background-color: " + windowColor + " }");
    quick->setStyleSheet("QMainWindow#QuickLaunch { background-color: " + windowColor + " }");
    favEdit->setStyleSheet("QMainWindow#FavoritesEdit { background-color: " + windowColor + " }");
    mainWindow->lifeSyncTitle_Label->setPixmap(QPixmap(QString(":/lifesync_images_icons/images/lifesync_images_icons/" + titleColor + ".png")));
    miniWindow->miniLife->miniTitle_Label->setPixmap(QPixmap(QString(":/lifesync_images_icons/images/lifesync_images_icons/" + titleColor + "_mini.png")));
}

/*
    The functions below will apply the appropriate color to the correct windows based upon user input or if default set all window colors to none

    Applies to: void allColor_WindowChanges();
                void mainColor_WindowChanges();
                void colorDefault_WindowChanges();
                void settingsColor_WindowChanges();
                void contactsColor_WindowChanges();
                void calendarColor_WindowChanges();
                void checklistColor_WindowChanges();
                void calculatorColor_WindowChanges();
                void informationColor_WindowChanges();
                void favoritesColor_WindowChanges();
*/
void LifeSync::allColor_WindowChanges()
{
    switch(windowColorCheck)
    {
        case 1:
            windowColor = "red";
            titleColor = "title_2";
            eachWindowColor_Functions(windowColor, titleColor);
            break;
        case 2:
            windowColor = "orange";
            titleColor = "title_2";
            eachWindowColor_Functions(windowColor, titleColor);
            break;
        case 3:
            windowColor = "yellow";
            titleColor = "title";
            eachWindowColor_Functions(windowColor, titleColor);
            break;
        case 4:
            windowColor = "green";
            titleColor = "title_2";
            eachWindowColor_Functions(windowColor, titleColor);
            break;
        case 5:
            windowColor = "rgb(0, 255, 255)";
            titleColor = "title";
            eachWindowColor_Functions(windowColor, titleColor);
            break;
        case 6:
            windowColor = "blue";
            titleColor = "title_2";
            eachWindowColor_Functions(windowColor, titleColor);
            break;
        case 7:
            windowColor = "rgb(255, 0, 255)";
            titleColor = "title_2";
            eachWindowColor_Functions(windowColor, titleColor);
            break;
        case 8:
            windowColor = "rgb(170, 0, 255)";
            titleColor = "title_2";
            eachWindowColor_Functions(windowColor, titleColor);
            break;
        case 9:
            windowColor = "rgb(255, 0, 127)";
            titleColor = "title_2";
            eachWindowColor_Functions(windowColor, titleColor);
            break;
        case 10:
            windowColor = "rgb(85, 0, 127)";
            titleColor = "title_2";
            eachWindowColor_Functions(windowColor, titleColor);
            break;
        default:
            errorDisplay = "Error: Invalid Color Check";
            mainWindow->newsAlerts_TextEdit->setText(errorDisplay);
    }
}

void LifeSync::settingsColor_WindowChanges()
{
    switch(windowColorCheck)
    {
        case 1:
            settings->setStyleSheet("QDialog#Settings { background-color: red }");
            break;

        case 2:
            settings->setStyleSheet("QDialog#Settings { background-color: orange }");
            break;

        case 3:
            settings->setStyleSheet("QDialog#Settings { background-color: yellow }");
            break;

        case 4:
            settings->setStyleSheet("QDialog#Settings { background-color: green }");
            break;

        case 5:
            settings->setStyleSheet("QDialog#Settings { background-color: rgb(0, 255, 255) }");
            break;

        case 6:
            settings->setStyleSheet("QDialog#Settings { background-color: blue }");
            break;

        case 7:
            settings->setStyleSheet("QDialog#Settings { background-color: rgb(255, 0, 255) }");
            break;

        case 8:
            settings->setStyleSheet("QDialog#Settings { background-color: rgb(170, 0, 255) }");
            break;

        case 9:
            settings->setStyleSheet("QDialog#Settings { background-color: rgb(255, 0, 127) }");
            break;

        case 10:
            settings->setStyleSheet("QDialog#Settings { background-color: rgb(85, 0, 127) }");
            break;

        default:
            errorDisplay = "Error: Invalid Color Check";
            mainWindow->newsAlerts_TextEdit->setText(errorDisplay);
    }
}

void LifeSync::informationColor_WindowChanges()
{
    switch(windowColorCheck)
    {
        case 1:
            info->setStyleSheet("QDialog#Info { background-color: red }");
            break;

        case 2:
            info->setStyleSheet("QDialog#Info { background-color: orange }");
            break;

        case 3:
            info->setStyleSheet("QDialog#Info { background-color: yellow }");
            break;

        case 4:
            info->setStyleSheet("QDialog#Info { background-color: green }");
            break;

        case 5:
            info->setStyleSheet("QDialog#Info { background-color: rgb(0, 255, 255) }");
            break;

        case 6:
            info->setStyleSheet("QDialog#Info { background-color: blue }");
            break;

        case 7:
            info->setStyleSheet("QDialog#Info { background-color: rgb(255, 0, 255) }");
            break;

        case 8:
            info->setStyleSheet("QDialog#Info { background-color: rgb(170, 0, 255) }");
            break;

        case 9:
            info->setStyleSheet("QDialog#Info { background-color: rgb(255, 0, 127) }");
            break;

        case 10:
            info->setStyleSheet("QDialog#Info { background-color: rgb(85, 0, 127) }");
            break;

        default:
            errorDisplay = "Error: Invalid Color Check";
            mainWindow->newsAlerts_TextEdit->setText(errorDisplay);
    }
}

void LifeSync::contactsColor_WindowChanges()
{
    switch(windowColorCheck)
    {
        case 1:
            contacts->setStyleSheet("QMainWindow#Contacts { background-color: red }");
            break;

        case 2:
            contacts->setStyleSheet("QMainWindow#Contacts { background-color: orange }");
            break;

        case 3:
            contacts->setStyleSheet("QMainWindow#Contacts { background-color: yellow }");
            break;

        case 4:
            contacts->setStyleSheet("QMainWindow#Contacts { background-color: green }");
            break;

        case 5:
            contacts->setStyleSheet("QMainWindow#Contacts { background-color: rgb(0, 255, 255) }");
            break;

        case 6:
            contacts->setStyleSheet("QMainWindow#Contacts { background-color: blue }");
            break;

        case 7:
            contacts->setStyleSheet("QMainWindow#Contacts { background-color: rgb(255, 0, 255) }");
            break;

        case 8:
            contacts->setStyleSheet("QMainWindow#Contacts { background-color: rgb(170, 0, 255) }");
            break;

        case 9:
            contacts->setStyleSheet("QMainWindow#Contacts { background-color: rgb(255, 0, 127) }");
            break;

        case 10:
            contacts->setStyleSheet("QMainWindow#Contacts { background-color: rgb(85, 0, 127) }");
            break;

        default:
            errorDisplay = "Error: Invalid Color Check";
            mainWindow->newsAlerts_TextEdit->setText(errorDisplay);
    }
}

void LifeSync::mainColor_WindowChanges()
{
    switch(windowColorCheck)
    {
        case 1:
            mainWindow->lifeSyncTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2.png")));
            qApp->setStyleSheet("QWidget#LifeSync { background-color: red }");
            miniWindow->miniLife->miniTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2_mini.png")));
            miniWindow->setStyleSheet("QMainWindow#MiniLifeSync { background-color: red }");
            break;

        case 2:
            mainWindow->lifeSyncTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2.png")));
            qApp->setStyleSheet("QWidget#LifeSync { background-color: orange }");
            miniWindow->miniLife->miniTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2_mini.png")));
            miniWindow->setStyleSheet("QMainWindow#MiniLifeSync { background-color: orange }");
            break;

        case 3:
            mainWindow->lifeSyncTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title.png")));
            qApp->setStyleSheet("QWidget#LifeSync { background-color: yellow }");
            miniWindow->miniLife->miniTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_mini.png")));
            miniWindow->setStyleSheet("QMainWindow#MiniLifeSync { background-color: yellow }");
            break;

        case 4:
            mainWindow->lifeSyncTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2.png")));
            qApp->setStyleSheet("QWidget#LifeSync { background-color: green }");
            miniWindow->miniLife->miniTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2_mini.png")));
            miniWindow->setStyleSheet("QMainWindow#MiniLifeSync { background-color: green }");
            break;

        case 5:
            mainWindow->lifeSyncTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title.png")));
            qApp->setStyleSheet("QWidget#LifeSync { background-color: rgb(0, 255, 255) }");
            miniWindow->miniLife->miniTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_mini.png")));
            miniWindow->setStyleSheet("QMainWindow#MiniLifeSync { background-color: rgb(0, 255, 255) }");
            break;

        case 6:
            mainWindow->lifeSyncTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2.png")));
            qApp->setStyleSheet("QWidget#LifeSync { background-color: blue }");
            miniWindow->miniLife->miniTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2_mini.png")));
            miniWindow->setStyleSheet("QMainWindow#MiniLifeSync { background-color: blue }");
            break;

        case 7:
            mainWindow->lifeSyncTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2.png")));
            qApp->setStyleSheet("QWidget#LifeSync { background-color: rgb(255, 0, 255) }");
            miniWindow->miniLife->miniTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2_mini.png")));
            miniWindow->setStyleSheet("QMainWindow#MiniLifeSync { background-color: rgb(255, 0, 255) }");
            break;

        case 8:
            mainWindow->lifeSyncTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2.png")));
            qApp->setStyleSheet("QWidget#LifeSync { background-color: rgb(170, 0, 255) }");
            miniWindow->miniLife->miniTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2_mini.png")));
            miniWindow->setStyleSheet("QMainWindow#MiniLifeSync { background-color: rgb(170, 0, 255) }");
            break;

        case 9:
            mainWindow->lifeSyncTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2.png")));
            qApp->setStyleSheet("QWidget#LifeSync { background-color: rgb(255, 0, 127) }");
            miniWindow->miniLife->miniTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2_mini.png")));
            miniWindow->setStyleSheet("QMainWindow#MiniLifeSync { background-color: rgb(255, 0, 127) }");
            break;

        case 10:
            mainWindow->lifeSyncTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2.png")));
            qApp->setStyleSheet("QWidget#LifeSync { background-color: rgb(85, 0, 127) }");
            miniWindow->miniLife->miniTitle_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/title_2_mini.png")));
            miniWindow->setStyleSheet("QMainWindow#MiniLifeSync { background-color: rgb(85, 0, 127) }");
            break;

        default:
            errorDisplay = "Error: Invalid Color Check";
            mainWindow->newsAlerts_TextEdit->setText(errorDisplay);
    }
}

void LifeSync::calendarColor_WindowChanges()
{
    switch(windowColorCheck)
    {
        case 1:
            calendarWindow->setStyleSheet("QMainWindow { background-color: red }");
            break;

        case 2:
            calendarWindow->setStyleSheet("QMainWindow { background-color: orange }");
            break;

        case 3:
            calendarWindow->setStyleSheet("QMainWindow { background-color: yellow }");
            break;

        case 4:
            calendarWindow->setStyleSheet("QMainWindow { background-color: green }");
            break;

        case 5:
            calendarWindow->setStyleSheet("QMainWindow { background-color: rgb(0, 255, 255) }");
            break;

        case 6:
            calendarWindow->setStyleSheet("QMainWindow { background-color: blue }");
            break;

        case 7:
            calendarWindow->setStyleSheet("QMainWindow { background-color: rgb(255, 0, 255) }");
            break;

        case 8:
            calendarWindow->setStyleSheet("QMainWindow { background-color: rgb(170, 0, 255) }");
            break;

        case 9:
            calendarWindow->setStyleSheet("QMainWindow { background-color: rgb(255, 0, 127) }");
            break;

        case 10:
            calendarWindow->setStyleSheet("QMainWindow { background-color: rgb(85, 0, 127) }");
            break;

        default:
            errorDisplay = "Error: Invalid Color Check";
            mainWindow->newsAlerts_TextEdit->setText(errorDisplay);
    }
}

void LifeSync::checklistColor_WindowChanges()
{
    switch(windowColorCheck)
    {
        case 1:
            check->setStyleSheet("QDialog#Checklist { background-color: red }");
            break;

        case 2:
            check->setStyleSheet("QDialog#Checklist { background-color: orange }");
            break;

        case 3:
            check->setStyleSheet("QDialog#Checklist { background-color: yellow }");
            break;

        case 4:
            check->setStyleSheet("QDialog#Checklist { background-color: green }");
            break;

        case 5:
            check->setStyleSheet("QDialog#Checklist { background-color: rgb(0, 255, 255) }");
            break;

        case 6:
            check->setStyleSheet("QDialog#Checklist { background-color: blue }");
            break;

        case 7:
            check->setStyleSheet("QDialog#Checklist { background-color: rgb(255, 0, 255) }");
            break;

        case 8:
            check->setStyleSheet("QDialog#Checklist { background-color: rgb(170, 0, 255) }");
            break;

        case 9:
            check->setStyleSheet("QDialog#Checklist { background-color: rgb(255, 0, 127) }");
            break;

        case 10:
            check->setStyleSheet("QDialog#Checklist { background-color: rgb(85, 0, 127) }");
            break;

        default:
            errorDisplay = "Error: Invalid Color Check";
            mainWindow->newsAlerts_TextEdit->setText(errorDisplay);
    }
}

void LifeSync::calculatorColor_WindowChanges()
{
    switch(windowColorCheck)
    {
        case 1:
            calculator->setStyleSheet("QDialog#Calculator { background-color: red }");
            break;

        case 2:
            calculator->setStyleSheet("QDialog#Calculatort { background-color: orange }");
            break;

        case 3:
            calculator->setStyleSheet("QDialog#Calculator { background-color: yellow }");
            break;

        case 4:
            calculator->setStyleSheet("QDialog#Calculator { background-color: green }");
            break;

        case 5:
            calculator->setStyleSheet("QDialog#Calculator { background-color: rgb(0, 255, 255) }");
            break;

        case 6:
            calculator->setStyleSheet("QDialog#Calculator { background-color: blue }");
            break;

        case 7:
            calculator->setStyleSheet("QDialog#Calculator { background-color: rgb(255, 0, 255) }");
            break;

        case 8:
            calculator->setStyleSheet("QDialog#Calculator { background-color: rgb(170, 0, 255) }");
            break;

        case 9:
            calculator->setStyleSheet("QDialog#Calculator { background-color: rgb(255, 0, 127) }");
            break;

        case 10:
            calculator->setStyleSheet("QDialog#Calculator { background-color: rgb(85, 0, 127) }");
            break;

        default:
            errorDisplay = "Error: Invalid Color Check";
            mainWindow->newsAlerts_TextEdit->setText(errorDisplay);
    }
}

void LifeSync::favoritesColor_WindowChanges()
{
    switch(windowColorCheck)
    {
        case 1:
            favEdit->setStyleSheet("QMainWindow#FavoritesEdit { background-color: red }");
            quick->setStyleSheet("QMainWindow#QuickLaunch { background-color: red }");
            break;

        case 2:
            favEdit->setStyleSheet("QMainWindow#FavoritesEdit { background-color: orange }");
            quick->setStyleSheet("QMainWindow#QuickLaunch { background-color: orange }");
            break;

        case 3:
            favEdit->setStyleSheet("QMainWindow#FavoritesEdit { background-color: yellow }");
            quick->setStyleSheet("QMainWindow#QuickLaunch { background-color: yellow }");
            break;

        case 4:
            favEdit->setStyleSheet("QMainWindow#FavoritesEdit { background-color: green }");
            quick->setStyleSheet("QMainWindow#QuickLaunch { background-color: green }");
            break;

        case 5:
            favEdit->setStyleSheet("QMainWindow#FavoritesEdit { background-color: rgb(0, 255, 255) }");
            quick->setStyleSheet("QMainWindow#QuickLaunch { background-color: rgb(0, 255, 255) }");
            break;

        case 6:
            favEdit->setStyleSheet("QMainWindow#FavoritesEdit { background-color: blue }");
            quick->setStyleSheet("QMainWindow#QuickLaunch { background-color: blue }");
            break;

        case 7:
            favEdit->setStyleSheet("QMainWindow#FavoritesEdit { background-color: rgb(255, 0, 255) }");
            quick->setStyleSheet("QMainWindow#QuickLaunch { background-color: rgb(255, 0, 255) }");
            break;

        case 8:
            favEdit->setStyleSheet("QMainWindow#FavoritesEdit { background-color: rgb(170, 0, 255) }");
            quick->setStyleSheet("QMainWindow#QuickLaunch { background-color: rgb(170, 0, 255) }");
            break;

        case 9:
            favEdit->setStyleSheet("QMainWindow#FavoritesEdit { background-color: rgb(255, 0, 127) }");
            quick->setStyleSheet("QMainWindow#QuickLaunch { background-color: rgb(255, 0, 127) }");
            break;

        case 10:
            favEdit->setStyleSheet("QMainWindow#FavoritesEdit { background-color: rgb(85, 0, 127) }");
            quick->setStyleSheet("QMainWindow#QuickLaunch { background-color: rgb(85, 0, 127) }");
            break;

        default:
            errorDisplay = "Error: Invalid Color Check";
            mainWindow->newsAlerts_TextEdit->setText(errorDisplay);
    }
}

void LifeSync::colorDefault_WindowChanges()
{
    windowColor = "none";
    titleColor = "title";
    eachWindowColor_Functions(windowColor, titleColor);
}

/*
    When the user clicks "Mini Version" in the settings window then enableLifeSyncMini()
    is called and the miniWindow is displayed and the mainWindow is hidden. Vice versa
    for the "Full Version"

    Applies to: void enableLifeSyncMini();
                void enableLifeSyncFull();
*/
void LifeSync::enableLifeSyncMini()
{
    miniWindow->show();
    miniWindow->move(this->pos().x(), this->pos().y());
    this->hide();
}

void LifeSync::enableLifeSyncFull()
{
    this->show();
    miniWindow->hide();
}

/*
    When the user unlocks a reward a popup window will be displayed to alert the user
    of the item unlocked.
*/
void LifeSync::rewardsUpdates()
{
    if(programCounter == 1)
    {
        if(disableSounds == false)
            //QSound::play( "../sounds/applause.wav" );
        unlock->show();
        unlock->move(this->frameGeometry().bottomLeft());
        unlock->unlock->reward_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/lifesync_avatar.png")));
        avatarReward = "LifeSync";
        unlock->unlock->display_Label->setText(avatarReward + " avatar unlocked!");
        settings->addListItem(avatarReward);
        settings->settingsWindow->bronzeMedal_LineEdit->setText("1");

        settings->rewardsPoints += 1;
    }

    if(programCounter >= 10)
    {
        settings->settingsWindow->lifeSyncMini_Button->setEnabled(true);
        settings->settingsWindow->miniVersion_Label->setEnabled(true);
        settings->settingsWindow->miniWindow_Label->setEnabled(true);
    }

    if(programCounter >= 20)
    {
        settings->settingsWindow->buttonStyleTitleTwo_Label->setEnabled(true);
        settings->settingsWindow->buttonsTwoPreview_Label->setEnabled(true);
        settings->settingsWindow->enableButtonsTwo_Button->setEnabled(true);
    }

    if(programCounter >= 30)
    {
        settings->settingsWindow->buttonStyleTitleThree_Label->setEnabled(true);
        settings->settingsWindow->buttonsThreePreview_Label->setEnabled(true);
        settings->settingsWindow->enableButtonsThree_Button->setEnabled(true);
    }

    if(programCounter >= 40)
    {
        settings->settingsWindow->buttonStyleTitleFour_Label->setEnabled(true);
        settings->settingsWindow->buttonsFourPreview_Label->setEnabled(true);
        settings->settingsWindow->enableButtonsFour_Button->setEnabled(true);
    }

    if(programCounter >= 50)
    {
        settings->settingsWindow->windowTransparency_Label->setEnabled(true);
        settings->settingsWindow->windowTransparency_Slider->setEnabled(true);
        settings->settingsWindow->windowTransparency_LineEdit->setEnabled(true);
    }

    for(int test = 0; test <= 50; test = test+5)
    {
        if(test == programCounter)
        {
            if(disableSounds == false)
                //QSound::play( "../sounds/applause.wav" );
            unlock->show();
            unlock->move(this->frameGeometry().bottomLeft());

            switch(programCounter)
            {
                case 5:
                    unlock->unlock->reward_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_cane.png")));
                    avatarReward = "Candy Cane";
                    unlock->unlock->display_Label->setText(avatarReward + " avatar unlocked!");
                    settings->addListItem(avatarReward);
                    settings->settingsWindow->bronzeMedal_LineEdit->setText("2");
                    settings->rewardsPoints += 1;
                    break;
                case 10:
                    unlock->unlock->reward_Label->setPixmap(QPixmap(QString::fromUtf8(":/lifesync_images_icons/images/lifesync_images_icons/lifesync.png")));
                    settings->settingsWindow->goldMedal_LineEdit->setText("1");
                    settings->rewardsPoints += 10;

                    settings->settingsWindow->rewardsUnlocked_List->item(2)->setIcon(QIcon(":/lifesync_images_icons/images/lifesync_images_icons/lifesync.png"));
                    settings->settingsWindow->rewardsUnlocked_List->item(2)->setText("Mini LifeSync");
                    break;
                case 15:
                    unlock->unlock->reward_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/gamer.png")));
                    avatarReward = "Gamer";
                    settings->settingsWindow->bronzeMedal_LineEdit->setText("3");
                    settings->rewardsPoints += 1;
                    break;
                case 20:
                    unlock->unlock->reward_Label->setPixmap(QPixmap(QString::fromUtf8(":/mainImages/versionTwo/mainWindow/images/mainImages/versionTwo/mainWindow/favorites.png")));
                    settings->settingsWindow->silverMedal_LineEdit->setText("1");
                    settings->rewardsPoints += 5;

                    settings->settingsWindow->rewardsUnlocked_List->item(4)->setIcon(QIcon(":/mainImages/versionTwo/mainWindow/images/mainImages/versionTwo/mainWindow/favorites.png"));
                    settings->settingsWindow->rewardsUnlocked_List->item(4)->setText("Button Style 2");
                    break;
                case 25:
                    unlock->unlock->reward_Label->setPixmap(QPixmap(QString::fromUtf8(":/holiday/images/holiday/christmas_tree.png")));
                    avatarReward = "Christmas Tree";
                    settings->settingsWindow->bronzeMedal_LineEdit->setText("4");
                    settings->rewardsPoints += 1;
                    break;
                case 30:
                    unlock->unlock->reward_Label->setPixmap(QPixmap(QString::fromUtf8(":/mainImages/versionThree/mainWindow/images/mainImages/versionThree/mainWindow/favorites.png")));
                    settings->settingsWindow->silverMedal_LineEdit->setText("2");
                    settings->rewardsPoints += 5;

                    settings->settingsWindow->rewardsUnlocked_List->item(6)->setIcon(QIcon(":/mainImages/versionThree/mainWindow/images/mainImages/versionThree/mainWindow/favorites.png"));
                    settings->settingsWindow->rewardsUnlocked_List->item(6)->setText("Button Style 3");
                    break;
                case 35:
                    unlock->unlock->reward_Label->setPixmap(QPixmap(QString::fromUtf8(":/extra/images/extra/linux.png")));
                    avatarReward = "Linux";
                    settings->settingsWindow->bronzeMedal_LineEdit->setText("5");
                    settings->rewardsPoints += 1;
                    break;
                case 40:
                    unlock->unlock->reward_Label->setPixmap(QPixmap(QString::fromUtf8(":/mainImages/versionFour/mainWindow/images/mainImages/versionFour/mainWindow/favorites.png")));
                    settings->settingsWindow->silverMedal_LineEdit->setText("3");
                    settings->rewardsPoints += 5;

                    settings->settingsWindow->rewardsUnlocked_List->item(8)->setIcon(QIcon(":/mainImages/versionFour/mainWindow/images/mainImages/versionFour/mainWindow/favorites.png"));
                    settings->settingsWindow->rewardsUnlocked_List->item(8)->setText("Button Style 4");
                    break;
                case 45:
                    unlock->unlock->reward_Label->setPixmap(QPixmap(QString::fromUtf8(":/avatars/images/avatars/warning_rhinoceros.png")));
                    avatarReward = "Rhino Xing";
                    settings->settingsWindow->bronzeMedal_LineEdit->setText("6");
                    settings->rewardsPoints += 1;
                    break;
                case 50:
                    unlock->unlock->reward_Label->setPixmap(QPixmap(QString::fromUtf8(":/settingsImages/images/settingsImages/window.png")));
                    settings->settingsWindow->goldMedal_LineEdit->setText("2");
                    settings->rewardsPoints += 10;

                    settings->settingsWindow->rewardsUnlocked_List->item(10)->setIcon(QIcon(":/settingsImages/images/settingsImages/window.png"));
                    settings->settingsWindow->rewardsUnlocked_List->item(10)->setText("Window Transparency");
                    break;
            }

            //If programCounter = 10, 20, 30, 40 or 50 then display a specific unlocked message to the user otherwise display the standard message
            if(programCounter == 10)
                unlock->unlock->display_Label->setText("Mini LifeSync mode unlocked!");
            else if(programCounter == 20)
                unlock->unlock->display_Label->setText("Button Style 2 unlocked!");
            else if(programCounter == 30)
                unlock->unlock->display_Label->setText("Button Style 3 unlocked!");
            else if(programCounter == 40)
                unlock->unlock->display_Label->setText("Button Style 4 unlocked!");
            else if(programCounter == 50)
                unlock->unlock->display_Label->setText("Transparency Window mode unlocked!");
            else
            {
                unlock->unlock->display_Label->setText(avatarReward + " avatar unlocked!");
                settings->addListItem(avatarReward);
            }
        }
    }

    //Set the QString rewardsTotalPoints equal to the value of rewardsPoints and display it in the settings rewards tab
    settings->rewardsTotalPoints = settings->rewardsTotalPoints.setNum(settings->rewardsPoints);
    settings->settingsWindow->totalPoints_LineEdit->setText(settings->rewardsTotalPoints);

    //Set the QString lifeSyncLaunches equal to the value of programCoutner and display it in the settings rewards tab
    settings->lifeSyncLaunches = settings->lifeSyncLaunches.setNum(programCounter);
    settings->settingsWindow->lifeSyncLaunches_LineEdit->setText(settings->lifeSyncLaunches);
}

/*
    If the user checks the "Disable Sounds" checkbox in the settings window
    then the sound is disabled and vice versa
*/
void LifeSync::lifeSyncSounds()
{
    if(disableSoundsCheck == 0)
    {
        disableSounds = true;
        disableSoundsCheck = 1;
    }
    else
    {
        disableSounds = false;
        disableSoundsCheck = 0;
    }
}

/*
    The functions below will play a sound upon their button clicks if the user hasn't disabled sounds and move the
    appropriate windows to the top right corner of the main LifeSync

    Applies to: void on_informationDisplay_Button_clicked();
                void on_settingsDisplay_Button_clicked();
                void on_calendarDisplay_Button_clicked();
                void on_checklistDisplay_Button_clicked();
                void on_contactsDisplay_Button_clicked();
                void on_calculatorDisplay_Button_clicked();
                void on_favoritesDisplay_Button_clicked();
*/
void LifeSync::on_informationDisplay_Button_clicked()
{
    if(disableSounds == false)
        QSound::play( "../sounds/click.wav" );

    info->move(this->frameGeometry().topRight());
    info->show();
}

void LifeSync::on_settingsDisplay_Button_clicked()
{
    if(disableSounds == false)
        QSound::play( "../sounds/click.wav" );

    settings->move(this->frameGeometry().topRight());
    settings->show();
}

void LifeSync::on_calendarDisplay_Button_clicked()
{
    if(disableSounds == false)
        QSound::play( "../sounds/click.wav" );

    calendarWindow->move(this->frameGeometry().topRight());
    calendarWindow->show();
}

void LifeSync::on_checklistDisplay_Button_clicked()
{
    if(disableSounds == false)
        QSound::play( "../sounds/click.wav" );

    check->move(this->frameGeometry().topRight());
    check->show();
}

void LifeSync::on_contactsDisplay_Button_clicked()
{
    if(disableSounds == false)
        QSound::play( "../sounds/click.wav" );

    contacts->move(this->frameGeometry().topRight());
    contacts->show();
}

void LifeSync::on_calculatorDisplay_Button_clicked()
{
    if(disableSounds == false)
        QSound::play( "../sounds/click.wav" );

    calculator->move(this->frameGeometry().topRight());
    calculator->show();
}

void LifeSync::on_favoritesDisplay_Button_clicked()
{
    if(disableSounds == false)
        QSound::play( "../sounds/click.wav" );

    favEdit->move(this->frameGeometry().topRight());
    favEdit->show();
}

/*
    The functions below will play a sound upon their button clicks if the user hasn't disabled sounds and move the
    appropriate windows to the bottom left corner of the main or mini LifeSync

    Applies to: void on_quickLaunchDisplay_Button_clicked();
                void miniQuickLaunchDisplay();
*/
void LifeSync::on_quickLaunchDisplay_Button_clicked()
{
    if(disableSounds == false)
        QSound::play( "../sounds/click.wav" );

    quick->move(this->frameGeometry().bottomLeft());
    quick->show();
}

void LifeSync::miniQuickLaunchDisplay()
{
    if(disableSounds == false)
        QSound::play( "../sounds/click.wav" );

    quick->move(miniWindow->frameGeometry().bottomLeft());
    quick->show();
}

//When the main LifeSync close button is clicked settings for Quick Launch, Favorites Edit, LifeSync Mini,
//Settings, and the main LifeSync are all saved
void LifeSync::on_closeLifeSync_Button_clicked()
{
    quick->writeQuickLaunchSettings();
    favEdit->writeFavoritesEditSettings();
    miniWindow->writeMiniLifeSyncSettings();
    settings->writeSettingsWindowSettings();
    writeSettings();
    this->close();
}

//When the user changes the transparency slider in the settings window all window transparencies are changed
void LifeSync::setLifeSyncWindowTransparency(int sliderValue)
{
    sliderDoubleValue = sliderValue * .1;

    this->setWindowOpacity(sliderDoubleValue);
    settings->setWindowOpacity(sliderDoubleValue);
    contacts->setWindowOpacity(sliderDoubleValue);
    favEdit->setWindowOpacity(sliderDoubleValue);
    quick->setWindowOpacity(sliderDoubleValue);
    miniWindow->setWindowOpacity(sliderDoubleValue);
    info->setWindowOpacity(sliderDoubleValue);
    unlock->setWindowOpacity(sliderDoubleValue);
    check->setWindowOpacity(sliderDoubleValue);
    calculator->setWindowOpacity(sliderDoubleValue);
    calendarWindow->setWindowOpacity(sliderDoubleValue);
}

/*
    The functions below will change the main and mini button styles based upon the user selection in the settings window

    Applies to: void enableButtonStyleOne();
                void enableButtonStyleTwo();
                void enableButtonStyleThree();
                void enableButtonStyleFour();
                void enableButtonStyles();
*/
void LifeSync::enableButtonStyleOne()
{
    buttonStyleNumber = "versionOne";
    enableButtonStyles();
}

void LifeSync::enableButtonStyleTwo()
{
    buttonStyleNumber = "versionTwo";
    enableButtonStyles();
}

void LifeSync::enableButtonStyleThree()
{
    buttonStyleNumber = "versionThree";
    enableButtonStyles();
}

void LifeSync::enableButtonStyleFour()
{
    buttonStyleNumber = "versionFour";
    enableButtonStyles();
}

void LifeSync::enableButtonStyles()
{
    mainWindow->contactsDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/mainWindow/images/mainImages/" + buttonStyleNumber + "/mainWindow/contacts.png)}");
    mainWindow->calculatorDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/mainWindow/images/mainImages/" + buttonStyleNumber + "/mainWindow/calculator.png)}");
    mainWindow->checklistDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/mainWindow/images/mainImages/" + buttonStyleNumber + "/mainWindow/checklist.png)}");
    mainWindow->calendarDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/mainWindow/images/mainImages/" + buttonStyleNumber + "/mainWindow/calendar.png)}");
    mainWindow->favoritesDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/mainWindow/images/mainImages/" + buttonStyleNumber + "/mainWindow/favorites.png)}");
    mainWindow->informationDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/mainWindow/images/mainImages/" + buttonStyleNumber + "/mainWindow/info.png)}");
    mainWindow->settingsDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/mainWindow/images/mainImages/" + buttonStyleNumber + "/mainWindow/settings.png)}");
    mainWindow->closeLifeSync_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/mainWindow/images/mainImages/" + buttonStyleNumber + "/mainWindow/quit.png)}");

    miniWindow->miniLife->miniContactsDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/miniWindow/images/mainImages/" + buttonStyleNumber + "/miniWindow/contacts.png)}");
    miniWindow->miniLife->miniCalculatorDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/miniWindow/images/mainImages/" + buttonStyleNumber + "/miniWindow/calculator.png)}");
    miniWindow->miniLife->miniChecklistDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/miniWindow/images/mainImages/" + buttonStyleNumber + "/miniWindow/checklist.png)}");
    miniWindow->miniLife->miniCalendarDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/miniWindow/images/mainImages/" + buttonStyleNumber + "/miniWindow/calendar.png)}");
    miniWindow->miniLife->miniFavoritesDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/miniWindow/images/mainImages/" + buttonStyleNumber + "/miniWindow/favorites.png)}");
    miniWindow->miniLife->miniInfoDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/miniWindow/images/mainImages/" + buttonStyleNumber + "/miniWindow/info.png)}");
    miniWindow->miniLife->miniSettingsDisplay_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/miniWindow/images/mainImages/" + buttonStyleNumber + "/miniWindow/settings.png)}");
    miniWindow->miniLife->miniExit_Button->setStyleSheet("QPushButton{background-image: url(:/mainImages/" + buttonStyleNumber + "/miniWindow/images/mainImages/" + buttonStyleNumber + "/miniWindow/quit.png)}");
}

LifeSync::~LifeSync()
{
    delete mainWindow;
}
